Skip to content

fix(core): preserve federated input payloads when cloning - #2156

Merged
xile611 merged 1 commit into
VisActor:developfrom
g1f9:fix/event-clone-payload-20261109
Nov 10, 2026
Merged

xile611 merged 1 commit into
VisActor:developfrom
g1f9:fix/event-clone-payload-20261109

Conversation

@g1f9

@g1f9 g1f9 commented Nov 9, 2026

Copy link
Copy Markdown
Contributor

🤔 This is a ...

  • Bug fix
  • TypeScript definition update
  • Test Case

🔗 Related issue link

VisActor/VChart#4725

💡 Background and solution

Cloning a pooled root pointer/wheel event without an EventManager throws while building its propagation path. Managed clones also drop Gesture/custom extension fields and replace the original timestamp. This forces delayed consumers such as VChart debounce/throttle callbacks to maintain their own snapshot implementation.

Mouse, pointer and wheel events now share the same cloning implementation: preserve event data and enumerable extension properties, detach the engine-owned coordinates and top-level path arrays, and reset dispatch state. Root events can be cloned without a manager. Targets, native/original events and extension objects retain their identity; this is not a deep clone of consumer-owned payloads.

IFederatedMouseEvent exposes clone(), and the accepted-input source documentation explains that async consumers must clone before the listener returns. The synchronous EventManager dispatch path is unchanged.

The PR contains only this fix and regression tests, based on develop abd20c6d0d1a8a67721125a17948ab1fb505830d. VChart dependency updates and removal of its temporary snapshot implementation must follow a VRender release containing this fix.

📝 Changelog

Language Changelog
English Fix federated input cloning to support root events and preserve timestamps, coordinates and Gesture/custom extension payloads.
Chinese 修复联邦输入事件克隆:支持无 manager 的 root event,保留时间戳、坐标及 Gesture/自定义扩展字段。

Validation

  • Confirmed four regression failures on the unmodified develop event implementation: root pointer/wheel exceptions, incomplete managed input data and missing Gesture payloads.
  • Core Jest suite: 118 suites / 763 tests passed, one suite / three tests skipped by the existing suite. Includes nine clone regressions and two real EventSystem canvas/window input reuse cases. Ran on Node 20.19.0 because the existing native Canvas dependency was built for Node 20.
  • Core TypeScript noEmit passes. Kits source TypeScript check passes with the repository's tsconfig.test.json source aliases and rootDir widened to packages; its normal artifact-based check cannot resolve the unbuilt core package in this isolated checkout.
  • Prettier and git diff --check pass.
  • ESLint on all six changed files retains exactly the develop diagnostics in src/interface/event.ts: two method-signature-style errors on InputEventSource.on/off and one unused IBounds warning. Compared the same source/rules against develop; no new diagnostics. This is not a clean lint result.
  • Existing Git hooks require the shared Rush installation and include incompatible shell syntax. Commit/push hooks were bypassed for this operation in favor of the explicit checks above.

Not run: full multi-package Rush tests/build, browser/Electron/mobile acceptance, performance benchmarking or VChart integration against a newly published package. CI and maintainer review remain separate.

☑️ Self-Check before Merge

  • Doc is updated/provided or not needed
  • Demo is updated/provided or not needed
  • TypeScript definition is updated/provided or not needed
  • Changelog is provided or not needed

🚀 Summary

copilot:summary

🔍 Walkthrough

copilot:walkthrough

@visactor-review-bot visactor-review-bot Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No confirmed new issues found.

@xile611
xile611 merged commit 5579b02 into VisActor:develop Nov 10, 2026
7 of 8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants